import request from '@/utils/request'

export function save(data) {
  return request({
    url: '/survey/',
    method: 'post',
    data
  })
}

export function getSurvey(id) {
  return request({
    url: `/survey/${id}/`,
    method: 'get',
  })
}


export function update(id,data) {
  return request({
    url: `/survey/${id}/`,
    method: 'patch',
    data
  })
}

export function submitSurvey(id,data) {
  return request({
    url: `/submit/${id}/`,
    method: 'post',
    data
  })
}

export function getSurveySubmit(id) {
  return request({
    url: `/survey/${id}/get_submit/`,
    method: 'get',
  })
}

export function delSurveySubmit(id) {
  return request({
    url: `/submit_survey/${id}/`,
    method: 'DELETE',
  })
}

export function getAllarea() {
  return request({
    url: `/all_area`,
    method: 'get',
  })
}

export function uploadImage(data) {
  return request({
    url: `/image`,
    method: 'post',
    data
  })
}

export function uploadFile(data) {
  return request({
    url: `/file`,
    method: 'post',
    data
  })
}

export function fileSuccess(data) {
  return request({
    url: `/filesuccess`,
    method: 'post',
    data
  })
}

export function fileCheck(data) {
  return request({
    url: `/file`,
    method: 'get',
    params:data
  })
}

export function SurveySubmitCheck(data) {
  return request({
    url: `/check`,
    method: 'post',
    data:data
  })
}
